const path = require('path');
const resolve = dir => path.resolve(__dirname, dir);
module.exports = {
  devServer: {
    port: 300,
    open: false,
    historyApiFallback: {
      disableDotRule: true,
    },
  },
  outputDir: "dist/",       // 项目输出目录
  assetsDir: 'static',        // 静态资源目录
  publicPath: './',
  filenameHashing: false,     // 生产环境关闭hash
  productionSourceMap: false, // 生产环境关闭jsmap
  chainWebpack: config => {
    config.resolve.alias
      .set('assets', '@/assets')
      .set('kkui', '@/assets/kkui')
      .set('js', '@/assets/js')
      .set('css', '@/assets/css')
      .set('img', '@/assets/img')
      .set('fonts', '@/assets/fonts')
      .set('comp', '@/components')
      .set('store', '@/store')
      .set('router', '@/router')
      .set('views', '@/views')
      .set('server', '@/server')
      .set('config', resolve('./public/config'))
      .set('vendor', resolve('./public/vendor'));

      // config.module
      // .rule('eslint')
      // .exclude.add('/public/vendor/map/tiles')
      // .end();
  },
  // configureWebpack: {
  //   module: {
  //     rules: [
  //       {
  //         test: /\.jsx?$/,
  //         exclude: /node_modules|tiles/, // 排除your-folder-name文件夹
  //       },
  //     ],
  //   },
  // },
};



